#ifndef __WIN32_ESVIEW_H__
#define __WIN32_ESView_H__

#include "View.h"

#if (CURRENT_PLATFORM == PLATFORM_WIN32_VS)

#define ESUTIL_API  __cdecl
#define ESCALLBACK  __cdecl

/// esCreateWindow flag - RGB color buffer
#define ES_WINDOW_RGB           0
/// esCreateWindow flag - ALPHA color buffer
#define ES_WINDOW_ALPHA         1 
/// esCreateWindow flag - depth buffer
#define ES_WINDOW_DEPTH         2 
/// esCreateWindow flag - stencil buffer
#define ES_WINDOW_STENCIL       4
/// esCreateWindow flat - multi-sample buffer
#define ES_WINDOW_MULTISAMPLE   8

class ESWin32View : public ESView 
{
private:
	TCHAR* m_wcsTitle;
	__INT32 m_iFlags;

	EGLNativeWindowType m_hWnd;
	EGLDisplay m_eglDisplay;
	EGLContext m_eglContext;
	EGLSurface m_eglSurface;
private:
	///Creates an EGL rendering context and all associated elements
	//	Create a window with the specified parameters
	//Input parameters:
	//	hWnd: EGL Windows handle
	//	eglDisplay: Set EGL Display
	//	eglContext: Set EGL Context
	//	eglSurface: Set EGL Surface
	//	attributeList: EGL list attribute
	//Output:
	//	TRUE: Create successful
	//	FALSE: Create fail
	///End
	EGLBoolean esCreateESContext(EGLint attribList[]);

	///Create Client Windows
	///End
	EGLBoolean esCreateClientWindows();

	static LRESULT esWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
public:
	ESWin32View();
	ESWin32View(__UINT32 iWidth, __UINT32 iHeight, TCHAR* wcsTitle, __UINT32 iFlags);
	~ESWin32View();

	///Initialize View Instance
	//	Static function
	//	It must be call before any orther function.
	//Input Parameters:
	//	esWin32View: Win32 need init
	///End
	static __VOID ESUTIL_API esInitWinView(ESWin32View* esWin32View);

	///Create Windows API
	///End
	EGLBoolean ESUTIL_API esCreateWindows();

	virtual __VOID Update();
	virtual __VOID Destroy();
};

#endif //PLATFORM_WIN32_VS

#endif